import store from "@/store";
import dayjs from "dayjs";
export const itemStyle = {
  marginBottom: 0,
  padding: "10px 40px",
};

// 表单配置项
export const formBase = [
  {
    type: "select",
    field: "belongingStoreId",
    label: "店铺",
    optionsKey: "companyName",
    optionsKey: "shopName",
    optionsValue: "id",
    options: store.state.custom_dict.shop, 
  }, 
  {
    type: "daterange",
    field: "shelfTime",
    label: "首单时间",
    otherOptions: {
      type: "datetimerange",
      rangeSeparator: "到",
      startPlaceholder: "开始日期",
      endPlaceholder: "结束日期",
      valueFormat: "yyyy-MM-dd HH:mm:ss",
      pickerOptions: {
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              const end = dayjs().format("YYYY-MM-DD 23:59:59");
              const start = dayjs().format("YYYY-MM-DD 00:00:00");
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "昨天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              end.setTime(start.getTime() - 3600 * 1000 * 24);
              start.setTime(start.getTime() - 3600 * 1000 * 24);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近三天",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一周",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
              picker.$emit("pick", [start, end]);
            },
          },
          {
            text: "最近一个月",
            onClick(picker) {
              const end = new Date(dayjs().format("YYYY-MM-DD 23:59:59"));
              const start = new Date(dayjs().format("YYYY-MM-DD 00:00:00"));
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
              picker.$emit("pick", [start, end]);
            },
          },
        ],
      },
      valueFormat: "yyyy-MM-dd HH:mm:ss",
    },
  },
];

// 表格配置项
export const tableBase1= [
  {
    label: "店铺",
    prop: "shop",
    width: 200,
  },
  {
    label: "新增加会员",
    prop: "addedUserNum",
    width: 140,
  },
  {
    label: "后台增加会员",
    prop: "backgroundUserNum",
    width: 140,
  },
  {
    label: "网站注册",
    prop: "webRegisterNum",
    width: 200,
  },
];

 
// 表格配置项
export const tableBase2 = [
  {
    label: "店铺",
    prop: "shop",
    width: 200,
  },
  {
    label: "会员ID",
    prop: "userId",
    width: 100,
  },
  {
    label: "会员昵称",
    prop: "userName",
    width: 140,
  },
  {
    label: "首笔订单成交日期",
    prop: "lastTransactionDate",
    width: 200,
  },
  {
    label: "订单总数",
    prop: "orderAmountNum",
    width: 140,
  },
  {
    label: "订单总金额",
    prop: "orderAmountMoney",
    width: 140,
  },
];


// 表格配置项
export const tableBase3 = [
  {
    label: "集运ID",
    prop: "id",
    width: 200,
  }, 
  {
    label: "订单时间",
    prop: "createTime",
    width: 200,
  }, 
  {
    label: "计费重量",
    prop: "actualWeight",
    width: 200,
  }, 
  {
    label: "使用积分",
    prop: "pointsFee",
    width: 200,
  }, 
  {
    label: "收件人",
    prop: "recipient",
    width: 200,
  }, 
  {
    label: "电话号码",
    prop: "phone",
    width: 200,
  }, 
  {
    label: "收货地址",
    prop: "address",
    width: 200,
  }, 
  {
    label: "运单号",
    prop: "transferOrderNumber",
    width: 200,
  }, 
  {
    label: "货物类型",
    prop: "cargoName",
    width: 100,
  }, 
  {
    label: "代收款",
    prop: "collectionAmount",
    width: 200,
  }, 
  {
    label: "目的国费用",
    prop: "amountInDestinationCountry",
    width: 200,
  }, 
  {
    label: "渠道",
    prop: "carrierCompany",
    width: 200,
  }, 
  {
    label: "实际运费",
    prop: "dueFee",
    width: 100,
  }, 
];
